package Test11.topic.cn.tedu;
/*用于作业设计模式--懒汉式*/
public class seji_lh {
    public static void main(String[] args) {
        MyZy z = MyZy.getLh();
        MyZy z1 = MyZy.getLh();
        System.out.println(z);
        System.out.println(z1);
        System.out.println(z==z1);
    }
}
class MyZy{
    private MyZy(){}
    private static MyZy lh ;
    public static MyZy getLh (){
        if(lh == null){
            lh = new MyZy();
        }
        return lh;
    }
}
